/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nanosl.minix.fxml;

import java.net.URL;
import java.util.ResourceBundle;
import javafx.animation.FadeTransition;
import javafx.animation.Timeline;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.util.Duration;

/**
 * FXML Controller class
 *
 * @author J.Sandun
 */
public class SalesViewController implements Initializable {
    @FXML
    private TextField itemTextField;
    @FXML
    private TextField codeTextField;
    @FXML
    private TextField priceTextField;
    @FXML
    private TextField quantityTextField;
    @FXML
    private Button updateButton;
    private Node Button;

    /**
     * Initializes the controller class.
     */
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        // TODO
    }    

    @FXML
    private void update(ActionEvent event) {
        FadeTransition ft = new FadeTransition(Duration.millis(100), Button);
        ft.setFromValue(1.0);
        ft.setToValue(0.1);
        ft.setCycleCount(Timeline.INDEFINITE);
        ft.setAutoReverse(true);
ft.play();
    }

    @FXML
    private void gotoQuantity(ActionEvent event) {
       quantityTextField.requestFocus();
        }

    @FXML
    private void addtoTableColumn(ActionEvent event) {
    }

    @FXML
    private void gotoPrice(ActionEvent event) {
        priceTextField.requestFocus();
    }
}
